Fix Win32 popup focus when using SSD
authorfirox263 <mjak923@aucklanduni.ac.nz>
Tue, 6 Oct 2020 09:37:35 +0000 (22:37 +1300)
committerfirox263 <mjak923@aucklanduni.ac.nz>
Tue, 6 Oct 2020 09:37:35 +0000 (22:37 +1300)
Prevents GDK Popups from stealing focus from the parent window when
using Server Side Decorations on win32.

It uses `ShowWindow` and the `SW_SHOWNOACTIVATE` flag.

gdk/win32/gdksurface-win32.c

index 69b71baf13c7502867d74c78609b14e061b3c2b7..3e9de289bd0b0c5adc7d46b251359c37154cc808 100644 (file)
@@ -1327,6 +1327,9 @@ gdk_win32_surface_raise (GdkSurface *window)
         API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOPMOST,
                                 0, 0, 0, 0,
                                 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
+         
+      else if (GDK_IS_POPUP (window))
+        ShowWindow (GDK_SURFACE_HWND (window), SW_SHOWNOACTIVATE);
       else
         /* Do not wrap this in an API_CALL macro as SetForegroundWindow might
          * fail when for example dragging a window belonging to a different